package com.ttbj.product.cutpayrevoke.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ttbj.api.cutpayrevoke.CutPayRevokeService;
import com.ttbj.api.dto.CutPayRevokeData;
import com.ttbj.api.dto.Page;
import com.ttbj.api.exception.BusinessException;
import com.ttbj.constant.PlatFormErrorCode;
import com.ttbj.cutpayrevoke.dao.CutPayRevokeMapper;



@Service("cutPayRevokeService")
public class CutPayRevokeServiceImpl implements CutPayRevokeService{

	@Autowired
	private CutPayRevokeMapper cutPayRevokeMapper;
	
	@Override
	public List<CutPayRevokeData> findCutPayRevokeByPage(CutPayRevokeData cutPayRevokeData, Page page)
			throws BusinessException {
		if (null == cutPayRevokeData) {
			throw new BusinessException("数据有错误！", PlatFormErrorCode.OBJECT_DOES_NOT_EXIST.code());
		}
		List<CutPayRevokeData> cutPayRevokeDatas = this.cutPayRevokeMapper.queryCutPayRevokeByPage(cutPayRevokeData, page);
		return cutPayRevokeDatas;
	}

	@Override
	public Integer findCutPayRevokeByPageCount(CutPayRevokeData cutPayRevokeData) throws BusinessException {
		if (null == cutPayRevokeData) {
			throw new BusinessException("数据有错误！", PlatFormErrorCode.OBJECT_DOES_NOT_EXIST.code());
		}
		Integer count = this.cutPayRevokeMapper.queryCutPayRevokeByPageCount(cutPayRevokeData);
		return count;
	}

}
